//
//  XDStarWarCell.m
//  XDEducation
//
//  Created by apple on 2017/4/13.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "XDStarWarCell.h"

@interface XDStarWarCell ()
@property (weak, nonatomic) IBOutlet UIImageView *errorsCampImageView;
@property (weak, nonatomic) IBOutlet UIImageView *unitCementImageView;
@property (weak, nonatomic) IBOutlet UIImageView *termCementImageView;

@end

@implementation XDStarWarCell

-(void)awakeFromNib{

    [super awakeFromNib];
    
    self.errorsCampImageView.userInteractionEnabled = YES;
    self.unitCementImageView.userInteractionEnabled = YES;
    self.termCementImageView.userInteractionEnabled = YES;
    
    //错题集中营手势
    UITapGestureRecognizer *errorsCamp = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(errorsCampEvent)];
    [self.errorsCampImageView addGestureRecognizer:errorsCamp];
    
    //单元巩固手势
    UITapGestureRecognizer *unitCement = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(unitCementEvent)];
    [self.unitCementImageView addGestureRecognizer:unitCement];
    
    //期中期末巩固
    UITapGestureRecognizer *termCement = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(termCementEvent)];
    [self.termCementImageView addGestureRecognizer:termCement];
    
}


-(void)errorsCampEvent{


    if (self.errorsCampBlock) {
        self.errorsCampBlock();
    }
}

-(void)unitCementEvent{

    if (self.uintCementBlock) {
        self.uintCementBlock();
    }
}

-(void)termCementEvent{

    if (self.termCementBlock) {
        self.termCementBlock();
    }
 
}

//单元巩固
- (IBAction)unitCement:(UIButton *)sender {
    
    [self unitCementEvent];
}

//期中期末巩固
- (IBAction)termCement:(UIButton *)sender {
    [self termCementEvent];
}


//错题集中营
- (IBAction)errorCamp:(UIButton *)sender {
    [self errorsCampEvent];
}

@end
